package cn.joeg.app.web.util;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class Const {

    public static final int user_companylev_max = 45 + 15;
    public static final int[] user_lev_exp = {
            100, 200, 320, 460, 620, 800, 1000, 1220, 1460, 1720, 2000, 2300, 2620, 2960, 3320, 3700, 4100,
            4520, 4960, 5420, 5900, 6400, 6920, 7460, 8020, 8600, 9200, 9820, 10460, 11120, 11800, 12500, 13220, 13960,
            14720, 15500, 16300, 17120,
            17960, 18820, 19700, 20600, 25000, 30000, 40000, 100000, 108000, 126000, 144000, 162000, 180000, 198000,
            216000, 234000, 252000, 270000,
            288000, 306000, 324000, 342000, 360000
    };
    /**
     * VIP购买行动力次数
     */
    public static final int[] user_buy_action_count_max = { 3, 4, 5, 7, 10, 15, 20, 36, 45, 60, 1000000 };
    /**
     * VIP一次购买行动力点数
     */
    public static final int[] user_vip_buy_action_num_max = { 50, 57, 65, 75, 87, 100, 112, 125, 137, 150, 175 };
    /**
     * VIP行动力上限
     */
    public static final int[] user_vip_action_max = { 200, 230, 260, 300, 350, 400, 450, 500, 550, 600, 700 };
    public static final int[] user_vip_pay_min = { 10, 50, 130, 300, 700, 1600, 3500, 8000, 18000, 38000 };
    /**
     * 0:和声, 1:歌者, 2:歌手, 3:歌星, 4:歌王/歌后, 5:天王/天后 对应的经验, 例如：singerlevel=2800, 则是歌者<br>
     * 龙套 配角 主角 影星 戏王/戏后 影帝/影后<br>
     * 伴舞 舞者 舞师 舞星 舞王/舞后 舞神/舞魔<br>
     * 职业经验, 大级别对应的经验, 12000 * 5 说明歌手有５个小级别
     */
    public static final long[] card_exp_need =
            { 1800, 3500 * 2, 12000 * 5, 150000 * 10, 1800000 * 10, 20000000 * 10 };
    public static final long card_exp_need_sum =
            card_exp_need[0] + card_exp_need[1] + card_exp_need[2] + card_exp_need[3] + card_exp_need[4] +
            card_exp_need[5];
    /**
     * 进化上限增加需要的经验 , 小级对应的经验
     */
    public static final long[] card_lev_exp = {
            1800, 3500, 3500, 12000, 12000, 12000, 12000, 12000, 150000, 150000, 150000, 150000, 150000,
            150000, 150000, 150000, 150000, 150000, 1800000, 1800000, 1800000, 1800000, 1800000, 1800000, 1800000,
            1800000, 1800000, 1800000,
            20000000, 20000000, 20000000, 20000000, 20000000, 20000000, 20000000, 20000000, 20000000, 20000000,
            20000000000l
    };
    public static final int CARD_D_MIN = 1;
    public static final int CARD_D_MAX = 30;
    public static final int CARD_C_MIN = 201;
    public static final int CARD_C_MAX = 230;
    public static final int CARD_B_MIN = 401;
    public static final int CARD_B_MAX = 420;
    public static final int CARD_A_MIN = 601;
    public static final int CARD_A_MAX = 620;
    public static final int CARD_S_MIN = 801;
    public static final int CARD_S_MAX = 820;
    public static final int CARD_SS_MIN = 1001;
    public static final int CARD_SS_MAX = 1042;
    public static final int CARD_SA_MIN = 1201;
    public static final int CARD_SA_MAX = 1234;
    // 卡品质
    public static final int CARD_LEVEL_D = 0;
    public static final int CARD_LEVEL_C = 1;
    public static final int CARD_LEVEL_B = 2;
    public static final int CARD_LEVEL_A = 3;
    public static final int CARD_LEVEL_S = 4;
    public static final int CARD_LEVEL_SS = 5;
    public static final int CARD_LEVEL_SA = 6;
    public static final int CARD_LEVEL_SSA = 7;
    /**
     * 天赋点数
     */
    public static final int[] card_points = { 0, 1, 3, 5, 6, 8, 10, 12, 14 };
    /**
     * 卡牌合成进阶价格
     */
    public static final int[] CARD_ADVANCE = { 3000000, 5500000, 8000000, 15000000, 2000, 3000, 5000, 7500, 10000 };
    /**
     * 卡牌合成进阶后属性增加值
     */
    public static final int[] CARD_ADV_P = { 0, 200, 280, 400, 550, 1000, 1600, 2300, 3200, 5000 };
    public static final Set<Integer> card_lead_indexs = new HashSet<>();
    /**
     * <天赋点数， 初始极限突破概率>
     */
    public static final Map<Integer, Integer> card_init_fabtprob = new HashMap<>();
    /**
     * 进化次数，进化值上限
     */
    public static final Map<Integer, Integer> card_upgrade_data = new HashMap<>();
    public static final long serialVersionUID = 2249470160230084597L;
    /**
     * 重置训练次数价格
     */
    public static final int card_retrain_diamond = 50;
    /**
     * 强化训练价格
     */
    public static final int card_train_diamond = 8;
    public static final int ITEM_C_MIN = 1;
    public static final int ITEM_C_MAX = 39;
    public static final int ITEM_B_MIN = 201;
    public static final int ITEM_B_MAX = 239;
    public static final int ITEM_A_MIN = 401;
    public static final int ITEM_A_MAX = 439;
    public static final int ITEM_S_MIN = 601;
    public static final int ITEM_S_MAX = 798;
    public static final int ITEM_SS_MIN = 1001;
    public static final int ITEM_SS_MAX = 1198;
    /**
     * 道具售价
     */
    public static final int[] item_pricearray = { 2000, 5000, 9000, 20000, 35000, 60000, 100000, 180000 };
    /**
     * 成长值
     */
    public static final int[] item_mixvalue = { 3, 11, 45, 203, 1016, 9000, 27001, 300000 };
    /**
     * 重置价格
     */
    public static final int[] item_refreshmoney
            = { 3000, 10000, 30000, 80000, 120000, 500000, 1000000, 2000000 };
    /**
     * 升级所需金币
     */
    public static final int[] item_mixmoney = { 3000, 10000, 30000, 80000, 120000, 500000, 1000000, 2000000 };
    /**
     * 合成钻石基数
     */
    public static final int[] item_mixdiamond = { 20, 50, 120, 200, 600, 1500, 6000 };
    public static final int store_type_money = 1;
    public static final int store_type_diamond = 2;
    public static final int store_good_type_item = 1;
    public static final int store_good_type_material = 2;
    public static final int across_ranknum = 32;
    public static int[] fans_exp = {
            5000, 15000, 33500, 60500, 96000, 140000, 192500, 253500, 323000, 401000, 487500, 582500, 686000,
            798000, 918500, 1047500, 1185000, 1331000, 1485500, 1648500, 1820000, 2000000, 2188500, 2385500, 2591000
    };
    // TODO 5人战修改
    public static int user_battle_card_maxnum = 5;


    /**
     * <天赋点数， 分解可得到的异能精华数>
     */
    public static final Map<Integer, Integer> card_breakdown_artdigest_num = new HashMap<>();
    /**
     * <天赋点数， 分解可得到的强效异能精华数>
     */
    public static final Map<Integer, Integer> card_breakdown_partdigest_num = new HashMap<>();
    /**
     * <天赋点数, level>
     */
    public static final Map<Integer, Integer> card_point_level = new HashMap<>();
    /**
     * <天赋点数, skilllevel>
     */
    public static final Map<Integer, Integer> card_point_skill_level = new HashMap<>();
    /**
     * <天赋点数， 努力值上限>
     */
    public static final Map<Integer, Integer> card_point_effortlimit = new HashMap<>();
    /**
     * <天赋点数， 每个位置最大天赋值>
     */
    public static final Map<Integer, Integer> card_point_max = new HashMap<>();
    /**
     * <天赋点数， 最大位置>
     */
    public static final Map<Integer, Integer> card_point_posnum = new HashMap<>();
    public static Set<Integer> card_can_not_lottery = new HashSet<>();
    public static int[] card_break_diamond = { 10, 20, 45, 90, 180, 360 };


    static {
        for (int i = 0; i < 150; i++) {
            // 每一轮的进化值(进化经验)上限, 训练上限增加 (i+1) 需要的进化经验(进化值)
            int expMax = 30 * (i + 1) * (i + 1) + 20 * (i + 1) + 50;
            card_upgrade_data.put(i, expMax);
        }

        card_point_max.put(0, 0);
        card_point_max.put(1, 1);
        card_point_max.put(3, 2);
        card_point_max.put(5, 2);
        card_point_max.put(8, 3);
        card_point_max.put(10, 4);
        card_point_max.put(12, 4);
        card_point_max.put(6, 3);
        card_point_max.put(14, 5);

        card_point_effortlimit.put(0, 20);
        card_point_effortlimit.put(1, 60);
        card_point_effortlimit.put(3, 240);
        card_point_effortlimit.put(5, 2400);
        card_point_effortlimit.put(6, 2400);
        card_point_effortlimit.put(8, 6000);
        card_point_effortlimit.put(10, 12000);
        card_point_effortlimit.put(12, 20000);

        card_breakdown_artdigest_num.put(0, 1);
        card_breakdown_artdigest_num.put(1, 3);
        card_breakdown_artdigest_num.put(3, 5);
        card_breakdown_artdigest_num.put(5, 30);
        card_breakdown_artdigest_num.put(8, 285);
        card_breakdown_artdigest_num.put(10, 520);
        card_breakdown_artdigest_num.put(12, 1250);
        card_breakdown_artdigest_num.put(14, 3000);

        card_breakdown_partdigest_num.put(0, 0);
        card_breakdown_partdigest_num.put(1, 0);
        card_breakdown_partdigest_num.put(3, 0);
        card_breakdown_partdigest_num.put(5, 0);
        card_breakdown_partdigest_num.put(8, 1);
        card_breakdown_partdigest_num.put(10, 4);
        card_breakdown_partdigest_num.put(12, 20);
        card_breakdown_partdigest_num.put(14, 100);

        // 卡牌等级 0:D 1:C 2:B 3:A 4:S, 4:S+, 5:SS
        card_point_level.put(0, 0);
        card_point_level.put(1, 1);
        card_point_level.put(3, 2);
        card_point_level.put(5, 3);
        card_point_level.put(6, 3);
        card_point_level.put(8, 4);
        card_point_level.put(10, 4);
        card_point_level.put(12, 5);
        card_point_level.put(14, 6);

        // 卡牌技能等级 0:D 1:C 2:B 3:A 4:S, 4:S+, 5:SS
        card_point_skill_level.put(0, 0);
        card_point_skill_level.put(1, 1);
        card_point_skill_level.put(3, 2);
        card_point_skill_level.put(5, 3);
        card_point_skill_level.put(6, 3);
        card_point_skill_level.put(8, 4);
        card_point_skill_level.put(10, 5);
        card_point_skill_level.put(12, 6);
        card_point_skill_level.put(14, 7);

        // 主角卡
        card_lead_indexs.add(30001);
        card_lead_indexs.add(30002);
        card_lead_indexs.add(30003);
        card_lead_indexs.add(30004);
        card_lead_indexs.add(30005);
        card_lead_indexs.add(30006);

        card_init_fabtprob.put(0, 60);
        card_init_fabtprob.put(1, 55);
        card_init_fabtprob.put(3, 50);
        card_init_fabtprob.put(5, 45);
        card_init_fabtprob.put(6, 45);
        card_init_fabtprob.put(8, 40);
        card_init_fabtprob.put(10, 35);
        card_init_fabtprob.put(12, 30);

        card_point_posnum.put(0, 0);
        card_point_posnum.put(1, 1);
        card_point_posnum.put(3, 2);
        card_point_posnum.put(5, 3);
        card_point_posnum.put(6, 3);
        card_point_posnum.put(8, 3);
        card_point_posnum.put(10, 3);
        card_point_posnum.put(12, 3);
        card_point_posnum.put(14, 3);

        initCannotLotteryCards();
    }

    public static void initCannotLotteryCards() {
        card_can_not_lottery.clear();
        card_can_not_lottery.add(1012);
        card_can_not_lottery.add(1015);
        card_can_not_lottery.add(1014);
        card_can_not_lottery.add(1018);
        card_can_not_lottery.add(1019);
        card_can_not_lottery.add(1020);
        card_can_not_lottery.add(1021);
        card_can_not_lottery.add(1022);
        card_can_not_lottery.add(1023);
        card_can_not_lottery.add(1024);
        card_can_not_lottery.add(1025);
        card_can_not_lottery.add(1026);
        card_can_not_lottery.add(1027);
        card_can_not_lottery.add(1028);
        card_can_not_lottery.add(1029);
        card_can_not_lottery.add(1030);
        card_can_not_lottery.add(1031);
        card_can_not_lottery.add(1032);
        card_can_not_lottery.add(1033);
        card_can_not_lottery.add(1034);
        card_can_not_lottery.add(1035);
        card_can_not_lottery.add(1036);
        card_can_not_lottery.add(1037);
        card_can_not_lottery.add(1038);
        card_can_not_lottery.add(1041);
        card_can_not_lottery.add(1042);
    }
}
